package com.sdp.wz.db.wz_vendor_wz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.core.bizc.db.IViewQuery;
import com.sdp.wz.db.wz_vendor_wz.entity.WzVendorWz;
import com.sdp.wz.db.wz_vendor_wz.mapper.WzVendorWzMapper;
import com.sdp.wz.db.wz_vendor_wz.service.IWzVendorWzService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-08-02
 */
@Service
public class WzVendorWzServiceImpl extends ServiceImpl<WzVendorWzMapper, WzVendorWz> implements IWzVendorWzService,IViewQuery {

	@Autowired
	private WzVendorWzMapper wzVendorWzMapper;
	
	
	@Override
	public <T> List<T> viewList(QueryWrapper<T> queryWrapper) {
		return wzVendorWzMapper.viewList(queryWrapper);
	}

	@Override
	public <T> int viewCount(QueryWrapper<T> queryWrapper) {
		return wzVendorWzMapper.viewCount(queryWrapper);
	}

	@Override
	public <T> IPage<T> viewPage(IPage<T> page, QueryWrapper<T> queryWrapper) {
		return wzVendorWzMapper.viewPage(page, queryWrapper);
	}

	@Override
	public List<WzVendorWz> queryWzVendorWzByvendorAndWarehouse(String warehouseCode, String vendorCode) {
		LambdaQueryWrapper<WzVendorWz> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WzVendorWz::getWarehouseCode, warehouseCode);
		queryWrapper.eq(WzVendorWz::getVendorCode, vendorCode);
		return list(queryWrapper);
	}

}
